
<template>
  <div class="addtype">
    <div class="biaoti">基本信息</div>
    <el-form ref="form" :model="form" label-width="100px" size="mini">
      <el-form-item label="假期类型">
        <el-input
          v-model="form.holidayType"
          placeholder="请输入"
          style="width: 220px"
        ></el-input>
      </el-form-item>
      <el-form-item label="适用范围">
        <el-select
          v-model="form.scopeOfApplication"
          placeholder="请选择"
          style="width: 220px"
        >
          <el-option label="全公司考勤" value="全公司考勤"></el-option>
          <el-option label="技术部考勤" value="技术部考勤"></el-option>
          <el-option
            label="技术部先锋组考勤"
            value="技术部先锋组考勤"
          ></el-option>
          <el-option label="产品部考勤" value="产品部考勤"></el-option>
          <el-option label="销售部考勤" value="销售部考勤"></el-option>
        </el-select>
      </el-form-item>
      <el-form-item label="单位时长">
        <el-select
          v-model="form.unitDuration"
          placeholder="请选择"
          style="width: 220px"
        >
          <el-option label="天" value="天"></el-option>
          <el-option label="半天" value="半天"></el-option>
          <el-option label="小时" value="小时"></el-option>
          <el-option label="分钟" value="分钟"></el-option>
        </el-select>
      </el-form-item>
      <el-form-item label="一天折算为"
        >工作时长
        <el-input v-model="form.workTime" style="width: 80px"></el-input>小时
      </el-form-item>
      <el-form-item label="是否限额">
        <el-radio-group v-model="form.isRestrictions">
          <el-radio label="限额"></el-radio>
          <el-radio label="不限额"></el-radio>
        </el-radio-group>
      </el-form-item>
    </el-form>

    <div class="biaoti">使用规则</div>
    <el-form ref="form" :model="form" label-width="110px" size="mini">
      <el-form-item label="请假证明">
        <el-radio-group v-model="form.leaveProve">
          <el-radio label="无需证明"></el-radio>
          <el-radio label="不限额"></el-radio>
        </el-radio-group>
      </el-form-item>
      <el-form-item label="计入请假的日期" prop="leaveDate">
        <el-checkbox-group v-model="form.leaveDate">
          <el-checkbox label="工作日" name="leaveDate"></el-checkbox>
          <el-checkbox label="休息日" name="leaveDate"></el-checkbox>
          <el-checkbox label="节假日" name="leaveDate"></el-checkbox>
        </el-checkbox-group>
      </el-form-item>
      <el-form-item label="单次最小时长">
        <el-radio-group v-model="form.minDuration">
          <el-radio label="不限制"></el-radio>
          <el-radio label="最少请假"></el-radio>
        </el-radio-group>
        <el-input v-model="form.minDuration" style="width: 80px"></el-input>天
      </el-form-item>
      <el-form-item label="单次最大时长">
        <el-radio-group v-model="form.maxDuration">
          <el-radio label="不限制"></el-radio>
          <el-radio label="最多请假"></el-radio>
        </el-radio-group>
        <el-input v-model="form.maxDuration" style="width: 80px"></el-input>天
      </el-form-item>
      <el-form-item label="申请时间限制">
        <el-radio-group v-model="form.filedRestrictions">
          <el-radio label="不限制"></el-radio>
          <el-radio label="提前"></el-radio>
        </el-radio-group>
        <el-input
          v-model="form.filedRestrictions"
          style="width: 80px"
        ></el-input
        >天提交申请
      </el-form-item>
      <el-form-item label="申请资格">
        <el-radio-group v-model="form.filedQualification">
          <el-radio label="不限制"></el-radio>、
          <el-radio label="转正后可申请"></el-radio>
          <el-radio label="入职"></el-radio>
        </el-radio-group>
        <el-input
          v-model="form.filedQualification"
          style="width: 80px"
        ></el-input
        >天提交申请
      </el-form-item>
    </el-form>

    <div class="biaoti">余额设置</div>
    <el-form ref="form" :model="form" label-width="110px" size="mini">
      <el-form-item label="发放方式">
        <el-select
          v-model="form.issuanceMethod"
          placeholder="请选择"
          style="width: 220px"
        >
          <el-option label="每月发放一次" value="每月发放一次"></el-option>
          <el-option label="每年发放一次" value="每年发放一次"></el-option>
        </el-select>
      </el-form-item>
      <el-form-item label="发放日期"
        >每月
        <el-input v-model="form.releaseDate" style="width: 80px"></el-input
        >号发放
      </el-form-item>
      <el-form-item label="发放规则">
        <el-select
          v-model="form.releaseRules"
          placeholder="请选择"
          style="width: 220px"
        >
          <el-option label="统一固定额度" value="统一固定额度"></el-option>
          <el-option
            label="按社会工龄(参加工作总年限)"
            value="按社会工龄(参加工作总年限)"
          ></el-option>
          <el-option
            label="按司龄(在本公司入职年限)"
            value="按司龄(在本公司入职年限)"
          ></el-option>

          <el-option
            label="社会工龄配额与司龄配额相加"
            value="社会工龄配额与司龄配额相加"
          ></el-option>
          <el-option
            label="职社会工龄与司龄配额的较大值"
            value="职社会工龄与司龄配额的较大值"
          ></el-option>
        </el-select>
      </el-form-item>
      <el-form-item label="发放额度">
        毎人每年发放
        <el-input v-model="form.issuanceQuota" style="width: 80px"></el-input>天
        <br />
        <el-radio-group v-model="form.issuanceQuota">
          <el-radio label="按实际工作时长发放"></el-radio>
        </el-radio-group>
        <br />
        每年1月1日发放6天假期,入职时间是6月1日的员工则按照半年发放3天假期,当余额出现小数时按照四舍五入取整
      </el-form-item>
      <el-form-item label="假期有效期">
        <el-radio-group v-model="form.holidayValidity">
          <el-radio label="永久有效"></el-radio>
          <el-radio label="发放日期起"></el-radio>
        </el-radio-group>
        <el-input v-model="form.holidayValidity" style="width: 80px"></el-input
        >周年内有效&nbsp;&nbsp;&nbsp;超过有效期,假期余额保留
        <el-input v-model="form.holidayValidity" style="width: 80px"></el-input
        >天提交申请
      </el-form-item>
      <el-form-item size="large" class="anniu">
        <el-button type="primary" @click="addtype()">提交</el-button>
        <el-button>取消</el-button>
      </el-form-item>
    </el-form>
  </div>
</template>

<script>
import axios from "axios";
export default {
  name: "AddType",
  data() {
    return {
      //新增表单
      form: {
        holidayType: "",
        scopeOfApplication: "",
        unitDuration: "",
        workTim: "",
        isRestrictions: "",
        leaveProve: "",
        leaveDate: "",
        minDuration: "",
        maxDuration: "",
        filedRestrictions: "",
        filedQualification: "",
        issuanceMethod: "",
        releaseDate: "",
        releaseRules: "",
        issuanceQuota: "",
        holidayValidity: "",
      },
    };
  },
  methods: {
    //新增假期类型
    addtype() {
        //  axios
        // .post("http://localhost:8030/class/addclass", this.form)
        // .then((res) => {
        //   this.tableData = res.data;
        //   if (res.data.code == 200) {
        //     this.$message({
        //       message: "恭喜你，新增成功",
        //       type: "success",
        //     });
        //   } else {
        //     this.$message.error("错了哦，新增失败");
        //   }
        // });
    },
  },
};
</script>

<style>

.biaoti {
  height: 40px;
  font-size: 15px;
}
</style>